(function($){
'use strict';
var _toBuild=[];
MK.api=window.MK.api||{};
MK.component.AdvancedGMaps=function(el){
var $this=$(el),
container=document.getElementById('mk-theme-container'),
data=$this.data('advancedgmaps-config'),
apikey=data.options.apikey ? ('key='+data.options.apikey+'&'):false,
map=null,
bounds=null,
infoWindow=null,
position=null;
var build=function(){
data.options.scrollwheel=false;
data.options.mapTypeId=google.maps.MapTypeId[data.options.mapTypeId];
data.options.styles=data.style;
bounds=new google.maps.LatLngBounds();
map=new google.maps.Map(el, data.options);
infoWindow=new google.maps.InfoWindow();
map.setOptions({
panControl:data.options.panControl,
draggable: data.options.draggable,
zoomControl: data.options.zoomControl,
mapTypeControl: data.options.scaleControl,
scaleControl: data.options.mapTypeControl,
});
var marker, i;
map.setTilt(45);
for (i=0; i < data.places.length; i++){
if(data.places[i].latitude&&data.places[i].longitude){
position=new google.maps.LatLng(data.places[i].latitude, data.places[i].longitude);
bounds.extend(position);
marker=new google.maps.Marker({
position: position,
map: map,
title: data.places[i].address,
icon: (data.places[i].marker) ? data.places[i].marker:data.icon
});
google.maps.event.addListener(marker, 'click', (function(marker, i){
return function(){
if(data.places[i].address&&data.places[i].address.length > 1){
infoWindow.setContent('
'+ data.places[i].address +'
');
infoWindow.open(map, marker);
}else{
infoWindow.setContent('');
infoWindow.close();
}};})(marker, i));
if(i > 0){
map.fitBounds(bounds);
}else{
var latLang={
lat: parseFloat(data.places[i].latitude),
lng: parseFloat(data.places[i].longitude)
};
map.setCenter(latLang);
map.setZoom(data.options.zoom);
}}
}
var boundsListener=google.maps.event.addListener((map), 'bounds_changed', function(event){
this.setZoom(data.options.zoom);
google.maps.event.removeListener(boundsListener);
});
var update=function(){
google.maps.event.trigger(map, "resize");
map.setCenter(position);
};
update();
var bindEvents=function(){
$(window).on('resize', update);
window.addResizeListener(container, update);
};
bindEvents();
};
var initAll=function(){
for(var i=0, l=_toBuild.length; i < l; i++){
_toBuild[i]();
}};
MK.api.advancedgmaps=MK.api.advancedgmaps||function(){
initAll();
};
return {
init:function(){
_toBuild.push(build);
MK.core.loadDependencies(['https://maps.googleapis.com/maps/api/js?'+apikey+'callback=MK.api.advancedgmaps']);
}};};
})(jQuery);
(function($){
'use strict';
function mk_animated_cols(){
function equalheight (container){
var currentTallest=0,
currentRowStart=0,
rowDivs=new Array(),
$el,
topPosition=0;
$(container).each(function(){
$el=$(this);
$($el).height('auto');
topPosition=$el.position().top;
if(currentRowStart!=topPosition){
for (var currentDiv=0 ; currentDiv < rowDivs.length ; currentDiv++){
rowDivs[currentDiv].height(currentTallest);
}
rowDivs.length=0;
currentRowStart=topPosition;
currentTallest=$el.height();
rowDivs.push($el);
}else{
rowDivs.push($el);
currentTallest=(currentTallest < $el.height()) ? ($el.height()):(currentTallest);
}
for (currentDiv=0 ; currentDiv < rowDivs.length ; currentDiv++){
rowDivs[currentDiv].height(currentTallest);
}});
return currentTallest;
}
function prepareCols(el){
var $this=el.parent().parent().find('.mk-animated-columns');
var iconHeight=equalheight('.vc_row .animated-column-icon, .animated-column-holder .mk-svg-icon'),
titleHeight=equalheight('.vc_row .animated-column-title'),
descHeight=equalheight('.vc_row .animated-column-desc'),
btnHeight=$this.find('.animated-column-btn').innerHeight();
if($this.hasClass('full-style')){
$this.find('.animated-column-item').each(function(){
var $this=$(this),
contentHeight=(iconHeight + 30) + (titleHeight + 10) + (descHeight + 70) + 34;
var $columnHeight=contentHeight * 1.5 + 50;
var $minHeight=parseInt($this.css('min-height'), 10);
if(! isNaN($minHeight)){
if($minHeight < $columnHeight){
$columnHeight=$minHeight;
}}
$this.height($columnHeight);
var $box_height=$this.outerHeight(true),
$icon_height=$this.find('.animated-column-icon, .animated-column-holder .mk-svg-icon').height();
$this.find('.animated-column-holder').css({
'paddingTop': $box_height / 2 - $icon_height
});
$this.animate({opacity:1}, 300);
});
}else{
$this.find('.animated-column-item').each(function(){
var $this=$(this),
halfHeight=$this.height() / 2,
halfIconHeight=$this.find('.animated-column-icon, .animated-column-holder .mk-svg-icon').height()/2,
halfTitleHeight=$this.find('.animated-column-simple-title').height()/2;
$this.find('.animated-column-holder').css({
'paddingTop': halfHeight - halfIconHeight
});
$this.find('.animated-column-title').css({
'paddingTop': halfHeight - halfTitleHeight
});
$this.animate({
opacity:1
}, 300);
});
}}
$('.mk-animated-columns').each(function(){
var that=this;
MK.core.loadDependencies([ MK.core.path.plugins + 'tweenmax.js' ], function(){
var $this=$(that),
$parent=$this.parent().parent(),
$columns=$parent.find('.column_container'),
index=$columns.index($this.parent());
if($this.hasClass('full-style')){
$this.find('.animated-column-item').hover(function(){
TweenLite.to($(this).find(".animated-column-holder"), 0.5, {
top: '-15%',
ease: Back.easeOut
});
TweenLite.to($(this).find(".animated-column-desc"), 0.5, {
top: '50%',
ease: Expo.easeOut
}, 0.4);
TweenLite.to($(this).find(".animated-column-btn"), 0.3, {
top: '50%',
ease: Expo.easeOut
}, 0.6);
},
function(){
TweenLite.to($(this).find(".animated-column-holder"), 0.5, {
top: '0%',
ease: Back.easeOut, easeParams:[3]
});
TweenLite.to($(this).find(".animated-column-desc"), 0.5, {
top: '100%',
ease: Back.easeOut
}, 0.4);
TweenLite.to($(this).find(".animated-column-btn"), 0.5, {
top: '100%',
ease: Back.easeOut
}, 0.2);
});
}
if($this.hasClass('simple-style')){
$this.find('.animated-column-item').hover(function(){
TweenLite.to($(this).find(".animated-column-holder"), 0.7, {
top: '100%',
ease: Expo.easeOut
});
TweenLite.to($(this).find(".animated-column-title"), 0.7, {
top: '0%',
ease: Back.easeOut
}, 0.2);
},
function(){
TweenLite.to($(this).find(".animated-column-holder"), 0.7, {
top: '0%',
ease: Expo.easeOut
});
TweenLite.to($(this).find(".animated-column-title"), 0.7, {
top: '-100%',
ease: Back.easeOut
}, 0.2);
});
}
if($columns.length===index + 1){
prepareCols($this);
$(window).on("resize", function(){
setTimeout(prepareCols($this), 1000);
});
}
MK.utils.eventManager.subscribe('iconsInsert', function(){
prepareCols($this);
});
});
});
}
$(window).on('load vc_reload', mk_animated_cols);
}(jQuery));
(function($){
'use strict';
var core=MK.core,
path=MK.core.path;
MK.component.BannerBuilder=function(el){
var init=function(){
var $this=$(el),
data=$this.data('bannerbuilder-config');
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.flexslider.js' ], function(){
$this.flexslider({
selector: '.mk-banner-slides > .mk-banner-slide',
animation: data.animation,
smoothHeight: false,
direction:'horizontal',
slideshow: true,
slideshowSpeed: data.slideshowSpeed,
animationSpeed: data.animationSpeed,
pauseOnHover: true,
directionNav: data.directionNav,
controlNav: false,
initDelay: 2000,
prevText: '',
nextText: '',
pauseText: '',
playText: ''
});
});
};
return {
init:init
};};
})(jQuery);
(function($){
'use strict';
var zIndex=0;
$('.mk-newspaper-wrapper').on('click', '.blog-loop-comments', function (event){
event.preventDefault();
var $this=$(event.currentTarget);
var $parent=$this.parents('.mk-blog-newspaper-item');
$parent.css('z-index', ++zIndex);
$this.parents('.newspaper-item-footer').find('.newspaper-social-share').slideUp(200).end().find('.newspaper-comments-list').slideDown(200);
setTimeout(function(){
MK.utils.eventManager.publish('item-expanded');
}, 300);
});
$('.mk-newspaper-wrapper').on('click', '.newspaper-item-share', function (event){
event.preventDefault();
var $this=$(event.currentTarget);
var $parent=$this.parents('.mk-blog-newspaper-item');
$parent.css('z-index', ++zIndex);
$this.parents('.newspaper-item-footer').find('.newspaper-comments-list').slideUp(200).end().find('.newspaper-social-share').slideDown(200);
setTimeout(function(){
MK.utils.eventManager.publish('item-expanded');
}, 300);
});
var init=function init(){
setTimeout(function(){
var $blog=$('.mk-blog-container');
var $imgs=$blog.find('img[data-mk-image-src-set]');
if($blog.hasClass('mk-blog-container-lazyload')&&$imgs.length){
$(window).on('scroll.mk_blog_lazyload', MK.utils.throttle(500, function(){
$imgs.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.ResponsiveImageSetter.init($(elem));
$imgs=$imgs.not($(elem));
}});
}));
$(window).trigger('scroll.mk_blog_lazyload');
$(window).trigger('resize')
MK.component.ResponsiveImageSetter.onResize($imgs);
}else{
MK.component.ResponsiveImageSetter.init($imgs);
MK.component.ResponsiveImageSetter.onResize($imgs);
}}, 50);
if($('body').hasClass('vc_editor')){
setTimeout(function(){
$(window).trigger('resize');
}, 2000)
}}
init();
$(window).on('vc_reload mk-image-loaded', init);
}(jQuery));
(function($){
'use strict';
var core=MK.core,
path=MK.core.path;
MK.component.Category=function(el){
var init=function(){
core.loadDependencies([ path.plugins + 'pixastic.js' ], function(){
blurImage($('.blur-image-effect .mk-loop-item .item-holder '));
});
core.loadDependencies([ path.plugins + 'minigrid.js' ], masonry);
};
var blurImage=function($item){
return $item.each(function(){
var $_this=$(this);
var img=$_this.find('.item-thumbnail');
img.clone().addClass("blur-effect item-blur-thumbnail").removeClass('item-thumbnail').prependTo(this);
var blur_this=$(".blur-effect", this);
blur_this.each(function(index, element){
if(img[index].complete===true){
Pixastic.process(blur_this[index], "blurfast", {amount:0.5});
}else{
blur_this.load(function (){
Pixastic.process(blur_this[index], "blurfast", {amount:0.5});
});
}});
});
};
var masonry=function(){
if(!$('.js-masonry').length) return;
function grid(){
minigrid({
container: '.js-masonry',
item: '.js-masonry-item',
gutter: 0
});
}
grid();
$(window).on('resize', grid);
};
return {
init:init
};};
})(jQuery);
(function($){
'use strict';
var core=MK.core,
path=core.path;
MK.component.Chart=function(el){
var init=function(){
MK.core.loadDependencies([MK.core.path.plugins + 'jquery.easyPieChart.js'], function(){
$('.mk-chart__chart').each(function(){
var $this=$(this),
$parent_width=$(this).parent().width(),
$chart_size=parseInt($this.attr('data-barSize'));
if($parent_width < $chart_size){
$chart_size=$parent_width;
$this.css('line-height', $chart_size);
$this.find('i').css({
'line-height': $chart_size + 'px'
});
$this.css({
'line-height': $chart_size + 'px'
});
}
var build=function(){
$this.easyPieChart({
animate: 1300,
lineCap: 'butt',
lineWidth: $this.attr('data-lineWidth'),
size: $chart_size,
barColor: $this.attr('data-barColor'),
trackColor: $this.attr('data-trackColor'),
scaleColor: 'transparent',
onStep: function(value){
this.$el.find('.chart-percent span').text(Math.ceil(value));
}});
};
MK.utils.scrollSpy(this, {
position: 'bottom',
after: build
});
});
});
};
return {
init: init
};};
})(jQuery);
(function($){
"use strict";
$('.mk-clients.column-style').each(function(){
var $group=$(this),
$listItems=$group.find('li'),
listItemsCount=$listItems.length,
listStyle=$group.find('ul').attr('style')||'',
fullRowColumnsCount=$group.find('ul:first-of-type li').length;
function recreateGrid(){
var i;
$listItems.unwrap();
if(window.matchMedia('(max-width: 550px)').matches&&fullRowColumnsCount >=1){
for (i=0; i < listItemsCount; i +=1){
$listItems.slice(i, i + 1)
.wrapAll('');
}}else if(window.matchMedia('(max-width: 767px)').matches&&fullRowColumnsCount >=2){
for (i=0; i < listItemsCount; i +=2){
$listItems.slice(i, i + 2)
.wrapAll('');
}}else if(window.matchMedia('(max-width: 960px)').matches&&fullRowColumnsCount >=3){
for (i=0; i < listItemsCount; i +=3){
$listItems.slice(i, i + 3)
.wrapAll('');
}}else{
for (i=0; i < listItemsCount; i +=fullRowColumnsCount){
$listItems.slice(i, i + fullRowColumnsCount)
.wrapAll('');
}}
}
recreateGrid();
$(window).on('resize', recreateGrid);
});
}(jQuery));
(function($){
'use strict';
$(window).on('vc_reload', function(){
$('.mk-event-countdown-ul').each(function(){
if($(this).width() < 750){
$(this).addClass('mk-event-countdown-ul-block');
}else{
$(this).removeClass('mk-event-countdown-ul-block');
}});
});
})(jQuery);
(function($){
'use strict';
$('.mk-edge-slider').find('video').each(function(){
this.pause();
this.currentTime=0;
});
MK.component.EdgeSlider=function(el){
var self=this,
$this=$(el),
$window=$(window),
$wrapper=$this.parent(),
config=$this.data('edgeslider-config'),
$nav=$(config.nav),
$prev=$nav.find('.mk-edge-prev'),
$prevTitle=$prev.find('.nav-item-caption'),
$prevBg=$prev.find('.edge-nav-bg'),
$next=$nav.find('.mk-edge-next'),
$nextTitle=$next.find('.nav-item-caption'),
$nextBg=$next.find('.edge-nav-bg'),
$navBtns=$nav.find('a'),
$pagination=$('.swiper-pagination'),
$skipBtn=$('.edge-skip-slider'),
$opacityLayer=$this.find('.edge-slide-content'),
$videos=$this.find('video'),
currentSkin=null,
currentPoint=null,
winH=null,
opacity=null,
offset=null;
var callbacks={
onInitialize:function(slides){
self.$slides=$(slides);
self.slideContents=$.map(self.$slides, function(slide){
var $slide=$(slide),
title=$slide.find('.edge-slide-content .edge-title').first().text(),
skin=$slide.attr("data-header-skin"),
image=$slide.find('.mk-section-image').attr('data-thumb') ||
$slide.find('.mk-video-section-touch').attr('data-thumb'),
bgColor=$slide.find('.mk-section-image').css('background-color');
return {
skin: skin,
title: title,
image: image,
bgColor: bgColor
};});
if(MK.utils.isSmoothScroll) $this.css('position', 'fixed');
setNavigationContent(1, self.$slides.length - 1);
setSkin(0);
playVideo(0);
setTimeout(function(){
$('.edge-slider-loading').fadeOut('100');
}, 1000);
},
onBeforeSlide:function(id){
},
onAfterSlide:function(id){
setNavigationContent(nextFrom(id), prevFrom(id));
setSkin(id);
stopVideos();
playVideo(id);
}};
var nextFrom=function nextFrom(id){
return(id + 1===self.$slides.length) ? 0:id + 1;
};
var prevFrom=function prevFrom(id){
return(id - 1===-1) ? self.$slides.length - 1:id - 1;
};
var setNavigationContent=function(nextId, prevId){
if(self.slideContents[ prevId ]){
$prevTitle.text(self.slideContents[ prevId ].title);
$prevBg.css('background',
self.slideContents[ prevId ].image!=='none' ?
'url(' + self.slideContents[ prevId ].image + ')' :
self.slideContents[ prevId ].bgColor);
}
if(self.slideContents[ nextId ]){
$nextTitle.text(self.slideContents[ nextId ].title);
$nextBg.css('background',
self.slideContents[ nextId ].image!=='none' ?
'url(' + self.slideContents[ nextId ].image + ')' :
self.slideContents[ nextId ].bgColor);
}};
var setSkin=function setSkin(id){
currentSkin=self.slideContents[ id ].skin;
$navBtns.attr('data-skin', currentSkin);
$pagination.attr('data-skin', currentSkin);
$skipBtn.attr('data-skin', currentSkin);
if(self.config.firstEl){
MK.utils.eventManager.publish('firstElSkinChange', currentSkin);
}};
var stopVideos=function stopVideos(){
$videos.each(function(){
this.pause();
this.currentTime=0;
});
};
var playVideo=function playVideo(id){
var video=self.$slides.eq(id).find('video').get(0);
if(video){
video.play();
console.log('play video in slide nr ' + id);
}};
var onResize=function onResize(){
var height=$wrapper.height();
$this.height(height);
var width=$wrapper.width();
$this.width(width);
winH=$window.height();
offset=$this.offset().top;
if(!MK.utils.isSmoothScroll) return;
if(MK.utils.isResponsiveMenuState()){
$this.css({
'-webkit-transform': 'translateZ(0)',
'-moz-transform': 'translateZ(0)',
'-ms-transform': 'translateZ(0)',
'-o-transform': 'translateZ(0)',
'transform': 'translateZ(0)',
'position': 'absolute'
});
$opacityLayer.css({
'opacity': 1
});
}else{
onScroll();
}};
var onScroll=function onScroll(){
currentPoint=- MK.val.scroll();
if(offset + currentPoint <=0){
opacity=1 + ((offset + currentPoint) / winH) * 2;
opacity=Math.min(opacity, 1);
opacity=Math.max(opacity, 0);
$opacityLayer.css({
opacity: opacity
});
}
$this.css({
'-webkit-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-moz-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-ms-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'-o-transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'transform': 'translateY(' + currentPoint + 'px) translateZ(0)',
'position': 'fixed'
});
};
onResize();
$window.on('load', onResize);
$window.on('resize', onResize);
window.addResizeListener($wrapper.get(0), onResize);
if(MK.utils.isSmoothScroll){
onScroll();
$window.on('scroll', function(){
if(MK.utils.isResponsiveMenuState()) return;
window.requestAnimationFrame(onScroll);
});
}
this.el=el;
this.config=$.extend(config, callbacks);
this.slideContents=null;
this.config.edgeSlider=true;
};
MK.component.EdgeSlider.prototype={
init:function(){
var slider=new MK.ui.Slider(this.el, this.config);
slider.init();
}};})(jQuery);
(function ($){
'use strict';
var init=function init(){
$('.mk-faq-wrapper').each(function(){
var $this=$(this);
var $filter=$this.find('.filter-faq');
var $filterItem=$filter.find('a');
var $faq=$this.find('.mk-faq-container > div');
var currentFilter='';
$filterItem.on('click', function(e){
var $this=$(this);
currentFilter=$this.data('filter');
$filterItem.removeClass('current');
$this.addClass('current');
filterItems(currentFilter);
e.preventDefault();
});
function filterItems(cat){
if(cat===''){
$faq.slideDown(200).removeClass('hidden');
return;
}
$faq.not('.' + cat).slideUp(200).addClass('hidden');
$faq.filter('.' + cat).slideDown(200).removeClass('hidden');
}});
}
init();
$(window).on('vc_reload', init);
}(jQuery));
(function ($){
'use strict';
function mk_flickr_feeds(){
$('.mk-flickr-feeds').each(function(){
var $this=$(this),
apiKey=$this.attr('data-key'),
userId=$this.attr('data-userid'),
perPage=$this.attr('data-count'),
column=$this.attr('data-column');
if(! $('.mk-flickr-feeds').is(':empty')){
return;
}
jQuery.getJSON('https://api.flickr.com/services/rest/?format=json&method=' + 'flickr.photos.search&api_key=' + apiKey + '&user_id=' + userId + '&&per_page=' + perPage + '&jsoncallback=?', function(data){
jQuery.each(data.photos.photo, function(i, rPhoto){
var basePhotoURL='http://farm' + rPhoto.farm + '.static.flickr.com/' + rPhoto.server + '/' + rPhoto.id + '_' + rPhoto.secret;
var thumbPhotoURL=basePhotoURL + '_q.jpg';
var mediumPhotoURL=basePhotoURL + '.jpg';
var photoStringStart=';';
var photoString=(i < perPage) ? photoStringStart + photoStringEnd:photoStringStart + photoStringEnd;
jQuery(photoString).appendTo($this);
});
});
});
}
mk_flickr_feeds();
$(window).on('vc_reload', mk_flickr_feeds);
})(jQuery);
jQuery(function($){
'use strict';
var init=function init(){
var $gallery=$('.mk-gallery');
var $imgs=$gallery.find('img[data-mk-image-src-set]');
if($gallery.hasClass('mk-gallery-lazyload')&&$imgs.length){
$(window).on('scroll.mk_gallery_lazyload', MK.utils.throttle(500, function(){
$imgs.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.ResponsiveImageSetter.init($(elem));
$imgs=$imgs.not($(elem));
}});
}));
$(window).trigger('scroll.mk_gallery_lazyload');
MK.component.ResponsiveImageSetter.onResize($imgs);
}else{
MK.component.ResponsiveImageSetter.init($imgs);
MK.component.ResponsiveImageSetter.onResize($imgs);
}}
init();
$(window).on('vc_reload mk-image-loaded', init);
});
(function($){
'use strict';
function mk_section_intro_effects(){
if(!MK.utils.isMobile()){
if(!$.exists('.mk-page-section.intro-true')) return;
$('.mk-page-section.intro-true').each(function(){
var that=this;
MK.core.loadDependencies([ MK.core.path.plugins + 'jquery.sectiontrans.js', MK.core.path.plugins + 'tweenmax.js' ], function(){
var $this=$(that),
$pageCnt=$this.parent().nextAll('div'),
windowHeight=$(window).height(),
effectName=$this.attr('data-intro-effect'),
$header=$('.mk-header');
var effect={
fade: new TimelineLite({paused: true})
.set($pageCnt, { opacity: 0, y: windowHeight * 0.3 })
.to($this, 1, { opacity: 0, ease:Power2.easeInOut })
.to($pageCnt, 1, { opacity: 1, y: 0, ease:Power2.easeInOut}, "-=.7")
.set($this, { zIndex: '-1'}),
zoom_out: new TimelineLite({paused: true})
.set($pageCnt, { opacity: 0, y: windowHeight * 0.3})
.to($this, 1.5, { opacity: .8, scale: 0.8, y: -windowHeight - 100, ease:Strong.easeInOut })
.to($pageCnt, 1.5, { opacity: 1, y: 0, ease:Strong.easeInOut}, "-=1.3"),
shuffle: new TimelineLite({paused: true})
.to($this, 1.5, { y: -windowHeight/2, ease:Strong.easeInOut })
.to($pageCnt.first(), 1.5, { paddingTop: windowHeight/2, ease:Strong.easeInOut }, "-=1.3")
};
console.log($pageCnt);
$this.sectiontrans({
effect: effectName
});
if($this.hasClass('shuffled')){
TweenLite.set($this, { y: -windowHeight/2 });
TweenLite.set($this.nextAll('div').first(), { paddingTop: windowHeight/2 });
}
$('body').on('page_intro', function(){
MK.utils.scroll.disable();
$(this).data('intro', true);
effect[effectName].play();
setTimeout(function(){
$header.addClass('pre-sticky');
$header.addClass('a-sticky');
$('.mk-header-padding-wrapper').addClass('enable-padding');
$('body').data('intro', false);
if(effectName==='shuffle') $this.addClass('shuffled');
}, 1000);
setTimeout(MK.utils.scroll.enable, 1500);
});
$('body').on('page_outro', function(){
MK.utils.scroll.disable();
$(this).data('intro', true);
effect[effectName].reverse();
setTimeout(function(){
$header.removeClass('pre-sticky');
$header.removeClass('a-sticky');
$('.mk-header-padding-wrapper').removeClass('enable-padding');
$('body').data('intro', false);
if($this.hasClass('shuffled')) $this.removeClass('shuffled');
}, 1000);
setTimeout(MK.utils.scroll.enable, 1500);
});
});
});
}else{
$('.mk-page-section.intro-true').each(function(){
$(this).attr('data-intro-effect', '');
});
}}
mk_section_intro_effects();
var debounceResize=null;
$(window).on("resize", function(){
if(debounceResize!==null){ clearTimeout(debounceResize); }
debounceResize=setTimeout(mk_section_intro_effects, 300);
});
function mk_section_adaptive_height(){
$(".mk-page-section.mk-adaptive-height").each(function(){
var imageHeight=$(this).find(".mk-adaptive-image").height();
$(this).css("height", imageHeight);
});
}
$(window).on("load resize", mk_section_adaptive_height);
var init=function init(){
var $allLayers=$('.mk-page-section .background-layer').filter(function(index){
var isLazyLoad=$(this).attr('data-mk-lazyload')==='true';
if(!isLazyLoad){
MK.component.BackgroundImageSetter.init($(this));
}
return isLazyLoad;
});;
if($allLayers.length){
$(window).on('scroll.mk_page_section_lazyload', MK.utils.throttle(500, function(){
$allLayers.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.BackgroundImageSetter.init($(elem));
$allLayers=$allLayers.not($(elem));
}});
}));
$(window).trigger('scroll.mk_page_section_lazyload');
MK.component.BackgroundImageSetter.onResize($allLayers);
}}
init();
$(window).on('vc_reload', init);
function mk_section_half_layout(){
$(".mk-page-section.half_boxed").each(function(){
var $section=$(this);
if($(window).width() > jupiterDonutVars.gridWidth){
var margin=($(window).width() - jupiterDonutVars.gridWidth) / 2;
var $section_inner=$section.find('.mk-half-layout-inner');
if($section.hasClass('half_left_layout')){
$section_inner.css({
marginRight: margin + 'px'
});
}
if($section.hasClass('half_right_layout')){
$section_inner.css({
marginLeft: margin + 'px'
});
}}
});
}
$(window).on("load resize", mk_section_half_layout);
function mk_reset_section_fluid_width_equal_height_columns(){
var $colWrappers='', maxWidth=850;
$colWrappers=$('.page-section-content.fluid-width-equal-height-columns');
$colWrappers.each(function(){
var $colWrapper='', colHeight=0;
$colWrapper=$(this);
$colWrapper.find('.wpb_column.column_container').each(function(){
var $col=$(this), size=$(this).children('div').length;
if(size > 0){
$col.removeAttr("style");
$col.children('div').each(function(){
var $this=$(this);
if(! $this.hasClass('mk-advanced-gmaps')){
$this.removeAttr('style');
}});
}});
});
}
function mk_section_fluid_width_equal_height_columns(){
mk_reset_section_fluid_width_equal_height_columns();
var $colWrappers='', maxWidth=850, $pageSection=$('.page-section-content');
if(! $pageSection.hasClass('.fluid-width-equal-height-columns')){
$pageSection.find('.wpb_column.column_container').removeAttr('style');
$pageSection.find('.wpb_column.column_container .vc_element').removeAttr('style');
}
$colWrappers=$('.page-section-content.fluid-width-equal-height-columns');
$colWrappers.each(function(){
var $colWrapper='', colHeight=0;
$colWrapper=$(this);
if($colWrapper.length > 0){
colHeight=$colWrappers.outerHeight(true);
$colWrapper.find('.wpb_column.column_container').each(function(){
var $col=$(this);
if($col.length > 0){
colHeight=($col.outerHeight(true) > colHeight) ? $col.outerHeight(true):colHeight;
}});
}
if(colHeight > 0){
$colWrapper.find('.wpb_column.column_container').each(function(){
var $col=$(this), size=$(this).children('div').length;
if(size > 0){
colHeight=($(window).width() < maxWidth) ? 'initial':colHeight;
$col.css("height", colHeight);
if($colWrapper.hasClass('vertical-align-center')){
$col.children('div').each(function(){
var elHeight=($(window).width() < maxWidth) ? 'initial':(colHeight/size);
if(! $(this).hasClass('mk-advanced-gmaps')){
$(this).css("height", elHeight);
}});
}}
});
}});
}
$(window).on('load vc_reload', function(){
setTimeout(function(){
mk_section_fluid_width_equal_height_columns();
}, 500);
});
var debounceResize=null;
$(window).on("resize", function(){
if(debounceResize!==null){ clearTimeout(debounceResize); }
debounceResize=setTimeout(mk_section_fluid_width_equal_height_columns(), 500);
});
}(jQuery));
(function($){
'use strict';
function mk_page_title_parallax(){
if(!MK.utils.isMobile()){
$('.mk-effect-wrapper').each(function(){
var $this=$(this),
progressVal,
currentPoint,
ticking=false,
scrollY=MK.val.scroll(),
$window=$(window),
windowHeight=$(window).height(),
parentHeight=$this.outerHeight(),
startPoint=0,
endPoint=$this.offset().top + parentHeight,
effectLayer=$this.find('.mk-effect-bg-layer'),
gradientLayer=effectLayer.find('.mk-effect-gradient-layer'),
cntLayer=$this.find('.mk-page-title-box-content'),
animation=effectLayer.attr('data-effect'),
top=$this.offset().top,
height=$this.outerHeight();
var parallaxSpeed=0.7,
zoomFactor=1.3;
var parallaxTopGap=function(){
var gap=top * parallaxSpeed;
effectLayer.css({
height:height + gap + 'px',
top:(-gap) + 'px'
});
};
if(animation==("parallax"||"parallaxZoomOut")){
parallaxTopGap();
}
var animationSet=function(){
scrollY=MK.val.scroll();
if(animation=="parallax"){
currentPoint=(startPoint + scrollY) * parallaxSpeed;
effectLayer.get(0).style.transform='translateY(' + currentPoint + 'px)';
}
if(animation=="parallaxZoomOut"){
console.log(effectLayer);
currentPoint=(startPoint + scrollY) * parallaxSpeed;
progressVal=(1 / (endPoint - startPoint) * (scrollY - startPoint));
var zoomCalc=zoomFactor - ((zoomFactor - 1) * progressVal);
effectLayer.get(0).style.transform='translateY(' + currentPoint + 'px) scale(' + zoomCalc + ')';
}
if(animation=="gradient"){
progressVal=(1 / (endPoint - startPoint) * (scrollY - startPoint));
gradientLayer.css({
opacity: progressVal * 2
});
}
if(animation!="gradient"){
progressVal=(1 / (endPoint - startPoint) * (scrollY - startPoint));
cntLayer.css({
opacity: 1 - (progressVal * 4)
});
}
ticking=false;
};
animationSet();
var requestTick=function(){
if(!ticking){
window.requestAnimationFrame(animationSet);
ticking=true;
}};
$window.off('scroll', requestTick);
$window.on('scroll', requestTick);
});
}}
var $window=$(window);
var debounceResize=null;
$window.on('load', mk_page_title_parallax);
$window.on("resize", function(){
if(debounceResize!==null){ clearTimeout(debounceResize); }
debounceResize=setTimeout(mk_page_title_parallax, 300);
});
}(jQuery));
(function($){
'use strict';
var utils=MK.utils,
core=MK.core,
path=MK.core.path;
MK.component.PhotoAlbum=function(el){
this.album=el;
this.initialOpen=false;
};
MK.component.PhotoAlbum.prototype={
dom: {
gallery: '.slick-slider-wrapper',
title: '.slick-title',
galleryContainer: '.slick-slides',
closeBtn: '.slick-close-icon',
thumbList: '.slick-dots',
thumbs: '.slick-dots li',
imagesData: 'photoalbum-images',
titleData: 'photoalbum-title',
idData: 'photoalbum-id',
urlData: 'photoalbum-url',
activeClass: 'is-active'
},
tpl: {
gallery: '#tpl-photo-album',
slide: ''
},
init: function(){
this.cacheElements();
this.bindEvents();
this.openByLink();
},
cacheElements: function(){
this.$album=$(this.album);
this.imagesSrc=this.$album.data(this.dom.imagesData);
this.albumLength=this.imagesSrc.length;
this.title=this.$album.data(this.dom.titleData);
this.id=this.$album.data(this.dom.idData);
this.url=this.$album.data(this.dom.urlData);
this.images=[];
},
bindEvents: function(){
this.$album.not('[data-photoalbum-images="[null]"]').on('click', this.albumClick.bind(this));
$(document).on('click', this.dom.closeBtn, this.closeClick.bind(this));
$(window).on('resize', this.thumbsVisibility.bind(this));
$(window).on('resize', this.makeArrows.bind(this));
},
albumClick: function(e){
e.preventDefault();
this.open();
MK.ui.loader.add(this.album);
},
closeClick: function(e){
e.preventDefault();
if(this.slider){
this.removeGallery();
this.slider.exitFullScreen();
}},
thumbsVisibility: function(){
if(!this.thumbsWidth) return;
if(window.matchMedia('(max-width:' + (this.thumbsWidth + 260) + 'px)').matches) this.hideThumbs();
else this.showThumbs();
},
hideThumbs: function(){
if(!this.$thumbList) return;
this.$thumbList.hide();
},
showThumbs: function(){
if(!this.$thumbList) return;
this.$thumbList.show();
},
open: function(){
var self=this;
core.loadDependencies([path.plugins + 'slick.js'], function(){
self.createGallery();
self.loadImages();
});
},
createGallery: function(){
if(!$(this.dom.gallery).length){
var tpl=$(this.tpl.gallery).eq(0).html();
$('body').append(tpl);
}
this.$gallery=$(this.dom.gallery);
this.$closeBtn=$(this.dom.closeBtn);
},
createSlideshow: function(){
var self=this;
this.slider=new MK.ui.FullScreenGallery(this.dom.galleryContainer, {
id: this.id,
url: this.url
});
this.slider.init();
$(window).trigger('resize');
this.makeArrows();
this.$thumbList=$(this.dom.thumbList);
this.$thumbs=$(this.dom.thumbs);
this.thumbsWidth=(this.$thumbs.length) * 95;
this.thumbsVisibility();
setTimeout(function(){
MK.ui.loader.remove(self.album);
}, 100);
MK.utils.eventManager.publish('photoAlbum-open');
},
makeArrows: function(){
if(this.arrowsTimeout) clearTimeout(this.arrowsTimeout);
this.arrowsTimeout=setTimeout(function(){
var $prev=$('.slick-prev').find('svg');
var $next=$('.slick-next').find('svg');
$prev.wrap('');
$next.wrap('');
if(matchMedia("(max-width: 1024px)").matches){
$prev.attr({
width: 12,
height: 22
}).find('polyline').attr('points', '12,0 0,11 12,22');
$next.attr({
width: 12,
height: 22
}).find('polyline').attr('points', '0,0 12,11 0,22');
}else{
$prev.attr({
width: 33,
height: 65
}).find('polyline').attr('points', '0.5,0.5 32.5,32.5 0.5,64.5');
$next.attr({
width: 33,
height: 65
}).find('polyline').attr('points', '0.5,0.5 32.5,32.5 0.5,64.5');
}}, 0);
},
loadImages: function(){
var self=this,
n=0;
if(!this.images.length){
this.imagesSrc.forEach(function(src){
if(src===null) return;
var img=new Image();
img.onload=function(){
self.onLoad(n +=1);
};
img.src=src;
self.images.push(img);
});
}else{
this.onLoad(this.albumLength);
}},
onLoad: function(n){
if(n===this.albumLength){
this.insertImages();
this.showGallery();
this.createSlideshow();
}},
insertImages: function(){
var $galleryContainer=this.$gallery.find(this.dom.galleryContainer),
$title=$(this.dom.title),
slide=this.tpl.slide;
$galleryContainer.html('');
$title.html(this.title);
this.images.forEach(function(img){
var $slide=$(slide);
$slide.html(img);
$galleryContainer.prepend($slide);
});
},
showGallery: function(){
var self=this;
this.$gallery.addClass(this.dom.activeClass);
utils.scroll.disable();
},
removeGallery: function(){
var self=this;
this.$gallery.removeClass(this.dom.activeClass);
setTimeout(function(){
self.$gallery.remove();
}, 300);
utils.scroll.enable();
},
openByLink: function(){
var loc=window.location,
hash=loc.hash,
id;
if(hash.length&&hash.substring(1).length){
id=hash.substring(1);
id=id.replace('!loading', '');
if(id==this.id&&!this.initialOpen){
this.initialOpen=true;
this.open();
}}
}};
MK.component.PhotoAlbumBlur=function(el){
var init=function(){
core.loadDependencies([path.plugins + 'pixastic.js'], function(){
blurImage($('.mk-album-item figure'));
});
};
var blurImage=function($item){
return $item.each(function(){
var $_this=$(this);
var img=$_this.find('.album-cover-image');
img.clone().addClass("blur-effect item-blur-thumbnail").removeClass('album-cover-image').prependTo(this);
var blur_this=$(".blur-effect", this);
blur_this.each(function(index, element){
if(img[index].complete===true){
Pixastic.process(blur_this[index], "blurfast", {
amount: 0.5
});
}else{
blur_this.load(function(){
Pixastic.process(blur_this[index], "blurfast", {
amount: 0.5
});
});
}});
});
};
return {
init: init
};};
})(jQuery);
jQuery(document).ready(function($){
if(typeof window.safari==='undefined'){
return;
}
function mkRedraw(){
$('.mk-photo-roller').hide().show(0);
}
mkRedraw();
$(window).resize(function(){
mkRedraw()
});
});
jQuery(function($){
'use strict';
var init=function init(){
var $portfolio=$('.portfolio-grid');
var $imgs=$portfolio.find('img[data-mk-image-src-set]');
if($portfolio.hasClass('portfolio-grid-lazyload')&&$imgs.length){
$(window).on('scroll.mk_portfolio_lazyload', MK.utils.throttle(500, function(){
$imgs.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.ResponsiveImageSetter.init($(elem));
$imgs=$imgs.not($(elem));
}});
}));
$(window).trigger('scroll.mk_portfolio_lazyload');
MK.component.ResponsiveImageSetter.onResize($imgs);
}else{
MK.component.ResponsiveImageSetter.init($imgs);
MK.component.ResponsiveImageSetter.onResize($imgs);
}}
init();
$(window).on('vc_reload mk-image-loaded', function(){
init();
$('.mk-portfolio-container').each(function(){
var id=$(this).attr('id');
var el='#' + id + '.mk-portfolio-container.js-el';
if($(this).data('mk-component')=='Grid'){
$(el).data('init-Grid', true);
var component=new MK.component[ 'Grid' ](el);
component.init();
}});
});
});
jQuery(document).ready(function($){
'use strict';
function get_item_width(style, showItems, id){
var item_width;
if(style=="classic"){
item_width=275;
items_to_show=4;
}else{
var screen_width=$('#portfolio-carousel-' + id).width(),
items_to_show=showItems;
if(screen_width >=1100){
item_width=screen_width / items_to_show;
}else if(screen_width <=1200&&screen_width >=800){
item_width=screen_width / 3;
}else if(screen_width <=800&&screen_width >=540){
item_width=screen_width / 2;
}else{
item_width=screen_width;
}}
return item_width;
}
jQuery(window).on("load vc_reload", function(){
MK.core.loadDependencies([MK.core.path.plugins + 'jquery.flexslider.js'], function(){
$('.portfolio-carousel .mk-flexslider').each(function(){
var $this=$(this);
var $pauseOnHover=$this.attr('data-pauseOnHover')=="true" ? true:false;
$this.flexslider({
selector: ".mk-flex-slides > li",
animation: "slide",
slideshowSpeed: parseInt($this.attr('data-slideshowSpeed')),
animationSpeed: parseInt($this.attr('data-animationSpeed')),
pauseOnHover: $pauseOnHover,
controlNav: false,
smoothHeight: false,
useCSS: false,
directionNav: $this.data('directionNav'),
prevText: "",
nextText: "",
itemWidth: get_item_width($this.data('style'), $this.data('showItems'), $this.data('id')),
itemMargin: 0,
maxItems: ($this.data('style')==='modern') ? $this.data('showItems'):4,
minItems: 1,
move: 1,
slideshow: false,
});
});
});
});
});
(function($){
if(window.addEventListener){
window.addEventListener('load', handleLoad, false);
}
else if(window.attachEvent){
window.attachEvent('onload', handleLoad);
}
function handleLoad(){
$('.mk-slideshow-box').each(run);
}
function run(){
var $slider=$(this);
var $slides=$slider.find('.mk-slideshow-box-item');
var $transition_time=$slider.data('transitionspeed');
var $time_between_slides=$slider.data('slideshowspeed');
$slider.find('.mk-slideshow-box-content').children('p').filter(function(){
if($.trim($(this).text())==''){
return true;
}}).remove();
$slides.first().addClass('active').fadeIn($transition_time, function(){
setTimeout(autoScroll, $time_between_slides);
});
function autoScroll(){
var $i=$slider.find('.active').index();
$slides.eq($i).removeClass('active').fadeOut($transition_time);
if($slides.length==$i + 1) $i=-1;
$slides.eq($i + 1).addClass('active').fadeIn($transition_time, function(){
setTimeout(autoScroll, $time_between_slides);
});
}
var browserName=MK.utils.browser.name;
if(browserName==='Firefox'||browserName==='Safari'){
var currentWidth=parseInt($(window).width());
if(currentWidth >=850){
var height=$slider.css('min-height');
if(typeof height!=='undefined'){
$slider.find('.mk-slideshow-box-items').height(parseInt(height));
}}else{
$slider.find('.mk-slideshow-box-items').removeAttr('style');
}}
}
$(window).on('vc_reload', function(){
handleLoad();
});
window.addEventListener('resize', function(){
var browserName=MK.utils.browser.name;
if(browserName==='Firefox'||browserName==='Safari'){
handleLoad();
}}, true);
}(jQuery));
(function($){
'use strict';
$(".mk-subscribe").each(function(){
var $this=$(this);
$this.find('.mk-subscribe--form').submit(function(e){
$this.addClass('form-in-progress');
e.preventDefault();
$.ajax({
url: MK.core.path.ajaxUrl,
type: "POST",
data: {
action: "mk_ajax_subscribe",
email: $this.find(".mk-subscribe--email").val(),
list_id: $this.find(".mk-subscribe--list-id").val(),
optin: $this.find(".mk-subscribe--optin").val()
},
success: function (response){
console.log(response)
$this.removeClass('form-in-progress');
var data=$.parseJSON(response),
$messaage_box=$this.find(".mk-subscribe--message");
$messaage_box.html(data.message);
if(data.action_status==true){
$messaage_box.addClass('success');
}else{
$messaage_box.addClass('error');
}
$this.find(".mk-subscribe--email").val('');
}});
});
});
}(jQuery));
(function($){
'use strict';
var _instancesCollection={};
var MK=window.MK||{};
window.MK=MK;
MK.component=window.MK.component||{};
MK.component.SwipeSlideshow=function(el){
var $this=$(el);
var id=$this.parent().attr('id');
this.el=el;
this.id=id;
this.config=$this.data('swipeslideshow-config');
if(this.config) this.config.hasPagination=false;
};
MK.component.SwipeSlideshow.prototype={
init:function(){
var slider=new MK.ui.Slider(this.el, this.config);
slider.init();
_instancesCollection[ this.id ]=slider;
}};
MK.component.SwipeSlideshowExtraNav=function(el){
this.el=el;
};
MK.component.SwipeSlideshowExtraNav.prototype={
init:function init(){
this.cacheElements();
this.bindEvents();
},
cacheElements:function cacheElements(){
var $this=$(this.el);
this.sliderId=$this.data('gallery');
this.slider=_instancesCollection[this.sliderId];
this.$thumbs=$('#' + this.sliderId).find('.thumbnails a');
},
bindEvents:function bindEvents(){
this.$thumbs.on('click', this.clickThumb.bind(this));
},
clickThumb:function clickThumb(e){
e.preventDefault();
var $this=$(e.currentTarget),
id=$this.index();
this.slider.goTo(id);
}};
MK.utils.eventManager.subscribe('gallery-update', function(e, config){
if(typeof _instancesCollection[config.id]==='undefined') return;
_instancesCollection[config.id].reset();
});
function init(){
var $swiper=$('.mk-swipe-slideshow');
var $imgs=$swiper.find('img[data-mk-image-src-set]');
if($swiper.hasClass('mk-swipe-slideshow-lazyload')&&$imgs.length){
$(window).on('scroll.mk_swipe_slideshow_lazyload', MK.utils.throttle(500, function(){
$imgs.each(function(index, elem){
if(MK.utils.isElementInViewport(elem)){
MK.component.ResponsiveImageSetter.init($(elem));
$imgs=$imgs.not($(elem));
}});
}));
$(window).trigger('scroll.mk_swipe_slideshow_lazyload');
MK.component.ResponsiveImageSetter.onResize($imgs);
}else{
MK.component.ResponsiveImageSetter.init($imgs);
MK.component.ResponsiveImageSetter.onResize($imgs);
}
/* Why we need to reinitialize it? it causes double sliding effect
$('.mk-swiper-container').each(function(){
new MK.component.SwipeSlideshow(this).init();
});
*/
}
init();
$(window).on('vc_reload mk-image-loaded', init);
})(jQuery);
(function($){
'use strict';
var core=MK.core,
path=core.path;
MK.component.Tooltip=function(el){
var init=function(){
$('.mk-tooltip').each(function(){
$(this).find('.mk-tooltip--link').hover(function(){
$(this).siblings('.mk-tooltip--text').stop(true).animate({
'opacity': 1
}, 400);
}, function(){
$(this).siblings('.mk-tooltip--text').stop(true).animate({
'opacity': 0
}, 400);
});
});
};
return {
init: init
};};
})(jQuery);
(function($){
'use strict';
function mkWcCarouselSwiperHeight(){
var mkWCRecentCarousel=$('.mk-woocommerce-carousel.classic-style');
mkWCRecentCarousel.each(function(){
var maxHeight=0;
var height=$(this).height();
var childs=$(this).find('.item');
childs.each(function(){
if($(this).height() > maxHeight){
maxHeight=$(this).height();
}});
var swiperContainers=$(this).find('.mk-swiper-container');
swiperContainers[0].style.setProperty('min-height', maxHeight + 'px', 'important');
});
}
mkWcCarouselSwiperHeight();
})(jQuery);
(function ($){
'use strict';
function dynamicHeight(){
var $this=$(this);
$this.height('auto');
if(window.matchMedia('(max-width: 768px)').matches){
return;
}
$this.height($this.height());
}
var $window=$(window);
var container=document.getElementById('mk-theme-container');
function equalColumns(){
$('.equal-columns').each(function(){
dynamicHeight.bind(this);
$window.on('load', dynamicHeight.bind(this));
$window.on('resize', dynamicHeight.bind(this));
$window.on('mk-image-loaded', dynamicHeight.bind(this));
window.addResizeListener(container, dynamicHeight.bind(this));
});
}
equalColumns();
$window.on('vc_reload' , function(){
equalColumns();
});
}(jQuery));
(function($){
'use strict';
function mk_video_play(){
var lightboxMargin=60;
function playSelfHosted($video, isLightbox){
if(isLightbox===undefined||typeof isLightbox==='undefined'){
isLightbox=false;
}
if(isLightbox){
var content=$video.parent().html();
playLightbox({
content: '' + $(content).attr('autoplay', 'autoplay').wrap('
').parent().html() + '
',
});
}else{
playTagVideo($video);
}}
function playSocialHosted($iframe, isLightbox){
if(isLightbox===undefined||typeof isLightbox==='undefined'){
isLightbox=false;
}
if(isLightbox){
playLightbox({
type: 'iframe',
href: $iframe.attr('src'),
helpers: {
media: true
}});
}else{
var videoData=getSocialVideoData($iframe.attr('src'));
switch (videoData.source){
case 'youtube':
playTagIframeYoutube(videoData.videoId, $iframe);
break;
case 'vimeo':
playTagIframeVimeo(videoData.videoId, $iframe);
break;
default:
playTagIframe($iframe);
break;
}}
}
function playLightbox(args){
var options={
padding: 0,
margin: lightboxMargin,
showCloseButton: 1,
autoSize: 0,
width: getVideoboxWidth(),
height: getVideoHeight(),
tpl: {
closeBtn: '',
},
};
$.extend(options, args);
$.fancybox.open(options);
}
function playTagVideo($video){
$video.get(0).play();
$video.closest('.video-container').find('.video-thumbnail').fadeOut('slow');
}
function playTagIframe($iframe, videoId){
var video_loop='';
if(videoId!==undefined&&typeof videoId!=='undefined'){
video_loop='&playlist=' + videoId;
}
var src=$iframe.attr('src');
var separator=(src.indexOf('?')===-1) ? '?':'&';
src +=separator + 'autoplay=1';
separator=(src.indexOf('?')===-1) ? '?':'&';
video_loop=separator + 'loop=1' + video_loop;
video_loop=($iframe.closest('.video-container').data('loop')=='1') ? video_loop:'';
src +=video_loop;
$iframe.attr('src', src).closest('.video-container').find('.video-thumbnail').fadeOut(3000);
}
function playTagIframeYoutube(videoId, $iframe){
if(document.getElementById('mk_iframe_api')===null){
var tag=document.createElement('script');
tag.src="https://www.youtube.com/iframe_api";
tag.id="mk_iframe_api";
var firstScriptTag=document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
}else{
runPlayer();
}
window.onYouTubeIframeAPIReady=function (){
runPlayer();
};
function runPlayer(){
var player,
isPlayed=false;
player=new YT.Player('video-player-' + $iframe.data('id'), {
videoId: videoId,
rel: false,
events: {
onReady: function(e){
e.target.playVideo();
},
onStateChange: function(e){
if(e.data===1&&!isPlayed){
$(e.target.a).closest('.video-container').find('.video-thumbnail').fadeOut('slow');
isPlayed=true;
}
if($(e.target.a).closest('.video-container').data('loop')&&e.data===YT.PlayerState.ENDED){
e.target.playVideo();
}},
onError: function(e){
playTagIframe($iframe, videoId);
}}
});
}}
function playTagIframeVimeo(videoId, $iframe){
$.getScript('//player.vimeo.com/api/player.js', function(data, textStatus, jqxhr){
if(jqxhr.status===200){
var player,
isPlayed=false;
player=new Vimeo.Player('video-player-' + $iframe.data('id'), {
id: videoId
});
player.play().then(function(){
if(!isPlayed){
$iframe.closest('.video-container').find('.video-thumbnail').fadeOut('slow');
isPlayed=true;
}}).catch(function(error){
playTagIframe($iframe);
});
if($iframe.closest('.video-container').data('loop')){
player.setLoop(true).then(function(loop){
}).catch(function(error){
playTagIframe($iframe);
});
}}else{
playTagIframe($iframe);
}});
}
function getSocialVideoData(url){
var youtubeRegex=/(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i;
var youtubeMatch=url.match(youtubeRegex);
if(youtubeMatch&&youtubeMatch!=null){
return {
source: 'youtube',
videoId: youtubeMatch[3]
};}
var vimeoRegex=/(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/i;
var vimeoMatch=url.match(vimeoRegex);
if(vimeoMatch&&vimeoMatch!=null){
return {
source: 'vimeo',
videoId: vimeoMatch[1]
};}
return {
source: false,
videoId: false
};}
function getVideoboxWidth(){
var $width,
wWidth=$(window).width(),
wHeight=$(window).height();
if(wHeight >=wWidth){
$width=wWidth - (lightboxMargin * 2);
}else{
var wHeightMax=(wHeight * 90) / 100;
if(wWidth > 1280){
var $width=(wHeightMax / 5768) * 10000;
}else{
var $width=(wHeightMax / 6120) * 10000;
}}
return Math.round($width) + 'px';
}
function getVideoHeight(){
var $height,
wWidth=$(window).width(),
wHeight=$(window).height();
if(wHeight >=wWidth){
$height=((wWidth - (lightboxMargin * 2)) * 5670) / 10000;
}else{
$height=((wHeight * 90) / 100) + (lightboxMargin * 2);
}
return Math.round($height) + 'px';
}
$('.video-container').each(function(){
var $videoContainer=$(this);
var playSource=$videoContainer.data('source');
var playTarget=$videoContainer.data('target');
var $iframe=$videoContainer.find('iframe');
var $video=$videoContainer.find('video');
if($videoContainer.data('autoplay')){
switch (playSource){
case 'social_hosted':
playSocialHosted($iframe);
break;
case 'self_hosted':
playSelfHosted($video);
break;
}}else{
var $playIcon=$videoContainer.find('.mk-svg-icon');
$playIcon.bind('click', function(e){
e.preventDefault();
var isLightbox=(playTarget=='lightbox') ? true:false;
if(!isLightbox){
$playIcon.hide().next('.preloader-preview-area').show();
}
switch (playSource){
case 'social_hosted':
playSocialHosted($iframe, isLightbox);
break;
case 'self_hosted':
playSelfHosted($video, isLightbox);
break;
}});
}});
}
$(window).on('load vc_reload', mk_video_play);
function mk_video_resize_play_icon(){
$('.video-thumbnail-overlay').each(function(){
var $thumbnailOverlay=$(this);
var thumbnailWidth=$thumbnailOverlay.width();
var $svg=$thumbnailOverlay.find('svg');
if(typeof $svg.data('width')==='undefined'){
$svg.attr('data-width', $svg.width());
}
if(typeof $svg.data('height')==='undefined'){
$svg.attr('data-height', $svg.height());
}
if(($svg.data('width') * 4) > thumbnailWidth){
$svg.css({
width: Math.round((parseInt(thumbnailWidth) / 4)) + 'px',
height: Math.round((parseInt(thumbnailWidth) / 4) * $svg.data('height') / $svg.data('width')) + 'px'
});
}else{
$svg.css({
width: $svg.data('width') + 'px',
height: $svg.data('height') + 'px'
});
}});
}
$(window).on('load resize orientationChange vc_reload', mk_video_resize_play_icon);
}(jQuery));
!function(c,d){"use strict";var e=!1,n=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},!c.wp.receiveEmbedMessage)if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,a,i,s=d.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=d.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=0;o=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)):(index=$tabs.tabs("option","active"),length=$tabs.find(".wpb_tab").length,index=jQuery(this).parent().hasClass("wpb_next_slide")?length<=index+1?0:index+1:index-1<0?length-1:index-1,$tabs.tabs("option","active",index))})})}}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $tabs,active_tab,collapsible,$this=jQuery(this);$this.attr("data-interval"),collapsible=!1===(active_tab=!isNaN(jQuery(this).data("active-tab"))&&0 div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){void 0!==jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}}),!0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:void 0===layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).on("click",function(e){e&&e.preventDefault&&e.preventDefault();var $thumbs=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),$thumbs.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).bind("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){($parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel")).each(function(){var $this=jQuery(this);if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){$this.data("carousel_enabled",!0);getColumnsCount(jQuery(this));jQuery(this).hasClass("columns_count_1")&&900;var carousel_li=jQuery(this).find(".wpb_thumbnails-fluid li");carousel_li.css({"margin-right":carousel_li.css("margin-left"),"margin-left":0});var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");fluid_ul.width(fluid_ul.width()+300),jQuery(window).on("resize",function(){screen_size!=(screen_size=getSizeName())&&window.setTimeout(function(){location.reload()},20)})}})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,this_element=jQuery(this);if(this_element.hasClass("wpb_slider_nivo")){var sliderTimeout=1e3*this_element.attr("data-interval");0===sliderTimeout&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:800,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})}else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){-1')}),vc_initVideoBackgrounds(),callSkrollInit=!1,window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSize,skrollrStart,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),($parallaxElement=$("").addClass("vc_parallax-inner").appendTo($(this))).height(skrollrSize+"%"),parallaxImage=$(this).data("vcParallaxImage"),(youtubeId=vcExtractYoutubeId(parallaxImage))?insertYoutubeVideoAsBackground($parallaxElement,youtubeId):void 0!==parallaxImage&&$parallaxElement.css("background-image","url("+parallaxImage+")"),skrollrStart=-(skrollrSize-100),$parallaxElement.attr("data-bottom-top","top: "+skrollrStart+"%;").attr("data-top-bottom","top: 0%;")}),callSkrollInit&&window.skrollr&&(vcSkrollrOptions={forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}},window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions),window.vcParallaxSkroll)}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){for(var find=!1,i=1;!1===find;){if(el.hasClass("columns_count_"+i))return find=!0,i;i++}});var screen_size=getSizeName();function getSizeName(){var screen_w=jQuery(window).width();return 1170').find(".inner");new YT.Player($container[0],{width:"100%",height:"100%",videoId:youtubeId,playerVars:{playlist:youtubeId,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,wmode:"transparent"},events:{onReady:function(event){event.target.mute().setLoop(!0)}}}),vcResizeVideoBackground($element),jQuery(window).bind("resize",function(){vcResizeVideoBackground($element)})}),"function"!=typeof window.vcResizeVideoBackground&&(window.vcResizeVideoBackground=function($element){var iframeW,iframeH,marginLeft,marginTop,containerW=$element.innerWidth(),containerH=$element.innerHeight();containerW/containerH<16/9?(iframeW=containerH*(16/9),iframeH=containerH,marginLeft=-Math.round((iframeW-containerW)/2)+"px",marginTop=-Math.round((iframeH-containerH)/2)+"px"):(iframeH=(iframeW=containerW)*(9/16),marginTop=-Math.round((iframeH-containerH)/2)+"px",marginLeft=-Math.round((iframeW-containerW)/2)+"px"),iframeW+="px",iframeH+="px",$element.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:marginLeft,marginTop:marginTop,width:iframeW,height:iframeH})}),"function"!=typeof window.vcExtractYoutubeId&&(window.vcExtractYoutubeId=function(url){if(void 0===url)return!1;var id=url.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!==id&&id[1]}),"function"!=typeof window.vc_googleMapsPointer&&(window.vc_googleMapsPointer=function(){var $=window.jQuery,$wpbGmapsWidget=$(".wpb_gmaps_widget");$wpbGmapsWidget.on("click",function(){$("iframe",this).css("pointer-events","auto")}),$wpbGmapsWidget.on("mouseleave",function(){$("iframe",this).css("pointer-events","none")}),$(".wpb_gmaps_widget iframe").css("pointer-events","none")}),"function"!=typeof window.vc_setHoverBoxPerspective&&(window.vc_setHoverBoxPerspective=function(hoverBox){hoverBox.each(function(){var $this=jQuery(this),perspective=4*$this.width()+"px";$this.css("perspective",perspective)})}),"function"!=typeof window.vc_setHoverBoxHeight&&(window.vc_setHoverBoxHeight=function(hoverBox){hoverBox.each(function(){var $this=jQuery(this),hoverBoxInner=$this.find(".vc-hoverbox-inner");hoverBoxInner.css("min-height",0);var frontHeight=$this.find(".vc-hoverbox-front-inner").outerHeight(),backHeight=$this.find(".vc-hoverbox-back-inner").outerHeight(),hoverBoxHeight=backHeighto.oldScroll?o.forward:o.backward;for(var r in this.waypoints[i]){var s=this.waypoints[i][r];if(null!==s.triggerPoint){var a=o.oldScroll=s.triggerPoint;(a&&l||!a&&!l)&&(s.queueTrigger(n),t[s.group.id]=s.group)}}}for(var h in t)t[h].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},n.prototype.innerHeight=function(){return this.element==this.element.window?y.viewportHeight():this.adapter.innerHeight()},n.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},n.prototype.innerWidth=function(){return this.element==this.element.window?y.viewportWidth():this.adapter.innerWidth()},n.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;o=r.oldScroll,p=!l&&!h,!w&&(l&&h)?(c.queueTrigger(r.backward),o[c.group.id]=c.group):!w&&p?(c.queueTrigger(r.forward),o[c.group.id]=c.group):w&&r.oldScroll>=c.triggerPoint&&(c.queueTrigger(r.forward),o[c.group.id]=c.group)}}return y.requestAnimationFrame(function(){for(var t in o)o[t].flushTriggers()}),this},n.findOrCreateByElement=function(t){return n.findByElement(t)||new n(t)},n.refreshAll=function(){for(var t in o)o[t].refresh()},n.findByElement=function(t){return o[t.waypointContextKey]},window.onload=function(){t&&t(),n.refreshAll()},y.requestAnimationFrame=function(t){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||e).call(window,t)},y.Context=n}(),function(){"use strict";function s(t,e){return t.triggerPoint-e.triggerPoint}function a(t,e){return e.triggerPoint-t.triggerPoint}var e={vertical:{},horizontal:{}},i=window.VcWaypoint;function o(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),e[this.axis][this.name]=this}o.prototype.add=function(t){this.waypoints.push(t)},o.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},o.prototype.flushTriggers=function(){for(var t in this.triggerQueues){var e=this.triggerQueues[t],i="up"===t||"left"===t;e.sort(i?a:s);for(var o=0,n=e.length;o